/*
 * Copyright 2022 The Open Islands Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.openislands.oi.dao.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Index;
import com.gitee.sunchenbin.mybatis.actable.annotation.TableComment;
import com.gitee.sunchenbin.mybatis.actable.annotation.Unique;
import org.apache.ibatis.type.BooleanTypeHandler;

import java.io.Serializable;

@TableComment("node route table")
@TableName(value = "t_node_route", autoResultMap = true)
public class NodeRouteDO extends BaseDO implements Serializable {
    @Unique(columns = {"f_node_id", "f_http_access"})
    @Column(isNull = false, length = 64)
    @TableField("f_node_id")
    private String nodeId;

    @Column(isNull = false, length = 255)
    @TableField("f_http_access")
    private String httpAccess;

    @Column(length = 255)
    @TableField("f_https_access")
    private String httpsAccess;

    @Column()
    @TableField("f_grpc_access")
    private String grpcAccess;

    @Column()
    @TableField("f_grpcs_access")
    private String grpcsAccess;

    @Column(isNull = false, defaultValue = "false")
    @TableField(value = "f_tls_enabled", typeHandler = BooleanTypeHandler.class)
    private Boolean tlsEnabled;

    @Index
    @Column(isNull = false, defaultValue = "true")
    @TableField(value = "f_enabled", typeHandler = BooleanTypeHandler.class)
    private Boolean enabled;

    public String getNodeId() {
        return nodeId;
    }

    public void setNodeId(String nodeId) {
        this.nodeId = nodeId;
    }

    public String getHttpAccess() {
        return httpAccess;
    }

    public void setHttpAccess(String httpAccess) {
        this.httpAccess = httpAccess;
    }

    public String getHttpsAccess() {
        return httpsAccess;
    }

    public void setHttpsAccess(String httpsAccess) {
        this.httpsAccess = httpsAccess;
    }

    public String getGrpcAccess() {
        return grpcAccess;
    }

    public void setGrpcAccess(String grpcAccess) {
        this.grpcAccess = grpcAccess;
    }

    public String getGrpcsAccess() {
        return grpcsAccess;
    }

    public void setGrpcsAccess(String grpcsAccess) {
        this.grpcsAccess = grpcsAccess;
    }

    public Boolean getTlsEnabled() {
        return tlsEnabled;
    }

    public void setTlsEnabled(Boolean tlsEnabled) {
        this.tlsEnabled = tlsEnabled;
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }
}